﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    //编号、书名、价格、出版社、作者信息
    class Library
    {
        private int ibsn;
        private string bookName;
        private double money;
        private string press;
        private string author;

        public int Ibsn
        {
            get
            {
                return this.ibsn;
            }
            set
            {
                this.ibsn = value;
            }
        }
        public string BookName
        {
            get
            {
                return this.bookName;
            }
            set
            {
                this.bookName = value;
            }
        }
        public double Money
        {
            get
            {
                return this.money;
            }
            set
            {
                if (value<0)
                {
                    this.money = 0;
                }
                else
                {
                    this.money = value;
                }
            }
        }
        public string Press
        {
            get
            {
                return this.press;
            }
            set
            {
                this.press = value;
            }
        }
        public string Author
        {
            get
            {
                return this.author;
            }
            set
            {
                this.author = value;
            }
        }

        public void ToString()
        {
            Console.WriteLine($"书编码{this.ibsn},书名{this.bookName},价格{this.money},出版社{this.press}，作者{this.author}");
        }

    }
}
